#pragma once
#include "RenderTech.h"

class CRenderColorBar :public RenderTech
{
public:
	CRenderColorBar(void);
	CRenderColorBar(unsigned int iWidth);
	virtual ~CRenderColorBar(void);

	virtual HRESULT OnD3D11CreateDevice(ID3D11Device* pd3dDevice, CDirectoryUtil* pDirUtil, void* pUserContext);
	virtual HRESULT OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain, 
		const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, CDirectoryUtil* pDirUtil, void* pUserContext );
	virtual void OnD3D11ReleasingSwapChain( void* pUserContext ){};
	virtual void OnD3D11DestroyDevice( void* pUserContext );
	virtual void OnD3D11FrameRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, CBaseCamera* pViewCamera, 
		CDirectoryUtil* pDirUtil, double fTime, float fElapsedTime, void* pUserContext );
	virtual void InitEffectsVariables();
	virtual void ReloadEffectsDebug(ID3D11Device* pd3dDevice, CDirectoryUtil* pDirUtil);
	HRESULT CreateColorBar(ID3D11Device* pd3dDevice);
	inline unsigned int GetBarWidth(){return m_iWidthBar;}
	HRESULT SetBarWidth(ID3D11Device* pd3dDevice, unsigned int iWidth);
public:
	ID3D11Texture1D* m_pColorBarTex;
	ID3D11ShaderResourceView* m_pColorBarTexSR;
	ID3D11Buffer*  m_pQuadVB;
	ID3D11InputLayout*    m_pVertexLayout;
	ID3DX11EffectTechnique* m_pRenderTech;	
	ID3DX11EffectShaderResourceVariable* m_pSampleTexSR;
	unsigned int m_iWidthBar;
	unsigned int m_iVPWidth;
	unsigned int m_iVPHeight;
	unsigned int m_iVPLeftX;
	unsigned int m_iVPLeftY;
};

